package com.authine.cloudpivot.ext.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.authine.cloudpivot.ext.domain.AppPackage;
import com.authine.cloudpivot.ext.service.ExtQuerySevice;
import com.authine.cloudpivot.web.api.controller.base.BaseController;
import com.authine.cloudpivot.web.api.view.ResponseResult;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 功能描述: 其他查询接口 〈〉 Param: Author: TED Date: 2021年5月21日 Version: 1.0
 */
@Api(value = "其他查询接口", tags = "01::EXTAPI::其他查询接口")
@RestController
@RequestMapping("/ext/query")
@Validated
@Component
@SuppressWarnings("rawtypes")
public class ExtQueryController extends BaseController {

    @Resource
    private ExtQuerySevice extQuerySevice;

    /**
     * 功能描述: 根据模型编码获取应用信息 〈〉 Param: [modelCode] Author: TED Date: 2021年5月21日 Version: 1.0
     */
    @ApiOperation(value = "根据模型编码获取应用信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "modelCode", value = "模型编码", required = true, paramType = "query",
        dataType = "String")})
    @GetMapping(value = "/getAppPackageByModelCode")
    public ResponseResult getAppPackageByModelCode(String modelCode) {
        AppPackage appPackage = extQuerySevice.getAppPackageByModelCode(modelCode);
        return getOkResponseResult(appPackage, "根据模型编码获取应用信息运行成功!");
    }

}
